package com.fdm.model.dao;

import java.sql.Connection;
import java.sql.SQLException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

public abstract class DAOFactory {
	//@Autowired
	//private HibernateDAOFactory hbDAOFactory;
	public static final int ORACLE=1;
	public static final int HIBERNATE=2;
	public abstract CustomerDAO getCustomerDAO();
	public static DAOFactory getDAOFactory(int whichFactory) throws SQLException{
		switch(whichFactory){
			case ORACLE:
				return new OracleDAOFactory();
				
			case HIBERNATE:
				//return hbDAOFactory;
				return new HibernateDAOFactory();
				
			default:
				return null;
		}
	}
}
